﻿using System;
using System.Drawing;
using System.Windows.Forms;
using Moonlite.ExtensionApi.ControlInterfaces;

namespace Moonlite.Modules.Editors.ImageViewer
{
    public partial class Viewer : Form, IDocumentEditor
    {
        public void Open(string path)
        {
            Image image = ImageViewerLoader.LoadImage(path);
            if (image != null)
            {
                pictureBox.Image = image;
            }
            else
            {
                MessageBox.Show("Unable to load image. The file could be corrupt or is of an unsupported format.", "Moonlite Map Studio");
            }
        }

        public Viewer()
        {
            InitializeComponent();
        }
    }
}
